package com.speakglobe.security.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.speakglobe.panelist.model.Panelist;

/**
 * Represents PIN. 
 */
@Entity
@Table(name="pin")
public class Pin implements Serializable {

	private static final long serialVersionUID = 6554904325012186877L;
	
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
	
	@ManyToOne
	@JoinColumn(name="buyer_id")
	private Panelist buyer;
	
	@ManyToOne
	@JoinColumn(name="user_id")
	private Panelist user;
	
	@Temporal(TemporalType.TIMESTAMP)
    private Date created;
    
    @Temporal(TemporalType.TIMESTAMP)
    private Date updated;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Panelist getBuyer() {
		return buyer;
	}

	public void setBuyer(Panelist buyer) {
		this.buyer = buyer;
	}

	public Panelist getUser() {
		return user;
	}

	public void setUser(Panelist user) {
		this.user = user;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}
    
    
	
}
